#[post("/ws_lib/menu")]
fn ws_menu(cookies: Cookies, state: State<MySqlDriver>) -> String {
	let user_info: UserInfo = get_cookies(&cookies);
    let pool_result: Result<Pool, mysql::Error> = Pool::new(state.driver.as_str());
    let pool: Pool;
    if let Ok(p) = pool_result {
        pool = p;
    } else {
        return "0".to_string();
    }
    let conn_result: Result<PooledConn, mysql::Error> = pool.get_conn();
    let mut conn: PooledConn;
    if let Ok(c) = conn_result {
        conn = c;
    } else {
        return "0".to_string();
    }

    let sql: String = format!("SELECT COUNT(`m`.`id`) AS `count` FROM `message` AS `m` INNER JOIN `copywrite_order` AS `copy_o` ON `copy_o`.`id` = `m`.`copywrite_order_id` INNER JOIN `tag_group` AS `tg` ON `tg`.`id` = `m`.`receive_group_id` WHERE (`m`.`receive_user_id` = {} OR `tg`.`admin_id_examine` = {} OR `tg`.`admin_id_publish` = {}) AND `m`.`is_read` = 0", user_info.id, user_info.id, user_info.id);
    let row: Row = conn.query_first(sql.clone()).unwrap().unwrap();
    let count: usize = from_row(row);
    return count.to_string();
}

